package org.rency.crawler.domain.queue;

import java.util.Objects;
import org.rency.common.utils.domain.Extension;
import org.rency.crawler.common.enums.HttpMethod;
import org.rency.crawler.domain.FetchExtension;

/**
 * 描述: ${TODO}<br>
 * 最近修改时间:2017/11/22 18:53<br>
 *
 * @author CaiyuRen
 * @version V1.0
 * @since 2017/11/22 18:53
 */
public class FetchQueue extends BaseQueue {

  /**
   * 抓取编号
   */
  private String             fetchNo;

  /**
   * 抓取目标
   */
  private String             fetchUri;

  /**
   * 域名编号
   */
  private String             fetchHost;

  /**
   * 域名地址
   */
  private String             hostAddr;

  /**
   * 请求方法
   */
  private HttpMethod         httpMethod;

  /**
   * 请求参数
   */
  private Extension          parameter;

  /**
   * 扩展
   */
  private FetchExtension     extension;

  public String getFetchNo() {
    return fetchNo;
  }

  public void setFetchNo(String fetchNo) {
    this.fetchNo = fetchNo;
  }

  public String getFetchUri() {
    return fetchUri;
  }

  public void setFetchUri(String fetchUri) {
    this.fetchUri = fetchUri;
  }

  public String getFetchHost() {
    return fetchHost;
  }

  public void setFetchHost(String fetchHost) {
    this.fetchHost = fetchHost;
  }

  public String getHostAddr() {
    return hostAddr;
  }

  public void setHostAddr(String hostAddr) {
    this.hostAddr = hostAddr;
  }

  public HttpMethod getHttpMethod() {
    return httpMethod;
  }

  public void setHttpMethod(HttpMethod httpMethod) {
    this.httpMethod = httpMethod;
  }

  public Extension getParameter() {
    return parameter;
  }

  public void setParameter(Extension parameter) {
    this.parameter = parameter;
  }

  public void setExtension(FetchExtension extension) {
    this.extension = extension;
  }

  public FetchExtension getExtension() {
    return extension;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FetchQueue queue = (FetchQueue) o;
    return Objects.equals(fetchNo, queue.fetchNo);
  }

  @Override
  public int hashCode() {
    return Objects.hash(fetchNo);
  }
}
